package com.example.lvsuo.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.lvsuo.aop.Flow;
import com.example.lvsuo.aop.MoKuaiEnum;
import com.example.lvsuo.entity.CaseSealApplyfor;
import com.example.lvsuo.entity.vo.CaseSealApplyforVo;
import com.example.lvsuo.modal.Result;
import com.example.lvsuo.service.ICaseSealApplyforService;
//import com.sun.org.apache.regexp.internal.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 案件/用印申请 前端控制器
 * </p>
 *
 * @author 心心念念
 * @since 2021-03-30
 */
@RestController
@RequestMapping("/caseSealApplyfor")
public class CaseSealApplyforController {

    @Autowired
    ICaseSealApplyforService cs;

    /**
     * 添加
     * @param c
     * @return
     */
    @Flow(tName = "case_seal_applyfor",KUAI_ENUM = MoKuaiEnum.YYSQ)
    @PostMapping
    Result addCaseSealApplyfor(@Valid CaseSealApplyfor c){
        cs.save(c);
        return Result.back("成功");
    }

    /**
     * 添加用印申请
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    Result queryCaseSealApplyfor(@PathVariable("id") String id){
        return Result.back(cs.queryCaseSealApplyfor(id));
    }

    @GetMapping()
    Result queryCaseSeal(String id){
        return Result.back(cs.queryCaseSeal(id));
    }

    @GetMapping("/caseSeal")
    Result query(CaseSealApplyforVo c){
        return Result.back(cs.querySeal(c));
    }


    /**
     * 批添
     * @param c
     * @return
     */
    @Flow(tName = "case_seal_applyfor",KUAI_ENUM = MoKuaiEnum.YYSQ)
    @PostMapping("/batch")
    Result addBatch(@Valid CaseSealApplyforVo c){
        cs.addBatch(c);
        return Result.back("成功");
    }
}

